#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
    int i = 1;
    int sum = 0;
    int k = 1;
    int count = 0;
    scanf("%d", &k);
    while ((k - count) >= i)
    {
        sum += i * i;
        count += i;
        i++;
    }
    if (count != k)
    {
        sum += (k - count) * i;
    }
    printf("%d\n", sum);
    return 0;
}